#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QDebug>



MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    cap_thread = new capture_thread;
    connect(cap_thread, SIGNAL(image_update(QImage)), this, SLOT(label_update_img(QImage)));
    cap_thread->start();
}

MainWindow::~MainWindow()
{
    delete cap_thread;
    delete ui;

}

void MainWindow::label_update_img(QImage img)
{
//    qDebug() << "label_update_img!" << endl;
    ui->label->setPixmap(QPixmap::fromImage(img));
}
